<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="generator" content="ApiGen; http://apigen.org" />

	<title>Class Nette\Application\Application</title>

	<link rel="stylesheet" href="resources/style.css?v=2011071314" type="text/css" media="all" />
	<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
	<link rel="search" href="opensearch.xml" type="application/opensearchdescription+xml" title="Nette Framework API documentation" />
	<script type="text/javascript" src="resources/combined.js"></script>
	<script type="text/javascript" src="allclasses.js"></script>
</head>

<body>
<div id="left">
	<a href="allclasses.html">All Classes</a>

	<h3>Namespaces</h3>
	<ul>
		<li><a href="namespace-none.html">none</a>
		</li>
		<li><a href="namespace-Nette.html">Nette</a>
		</li>
		<li class="active"><a href="namespace-Nette.Application.html">Nette\Application</a>
		</li>
		<li><a href="namespace-Nette.Caching.html">Nette\Caching</a>
		</li>
		<li><a href="namespace-Nette.Collections.html">Nette\Collections</a>
		</li>
		<li><a href="namespace-Nette.Config.html">Nette\Config</a>
		</li>
		<li><a href="namespace-Nette.Forms.html">Nette\Forms</a>
		</li>
		<li><a href="namespace-Nette.IO.html">Nette\IO</a>
		</li>
		<li><a href="namespace-Nette.Loaders.html">Nette\Loaders</a>
		</li>
		<li><a href="namespace-Nette.Mail.html">Nette\Mail</a>
		</li>
		<li><a href="namespace-Nette.Reflection.html">Nette\Reflection</a>
		</li>
		<li><a href="namespace-Nette.Security.html">Nette\Security</a>
		</li>
		<li><a href="namespace-Nette.Templates.html">Nette\Templates</a>
		</li>
		<li><a href="namespace-Nette.Web.html">Nette\Web</a>
		</li>
		<li><a href="namespace-PHP.html">PHP</a>
		</li>
	</ul>

	<hr />

	<h3>Classes</h3>

	<ul>
		<li><a href="Nette.Application.AppForm.html">AppForm</a></li>
		<li class="active"><a href="Nette.Application.Application.html">Application</a></li>
		<li><a href="Nette.Application.CliRouter.html">CliRouter</a></li>
		<li><a href="Nette.Application.Control.html">Control</a></li>
		<li><a href="Nette.Application.DownloadResponse.html">DownloadResponse</a></li>
		<li><a href="Nette.Application.ForwardingResponse.html">ForwardingResponse</a></li>
		<li><a href="Nette.Application.JsonResponse.html">JsonResponse</a></li>
		<li><a href="Nette.Application.Link.html">Link</a></li>
		<li><a href="Nette.Application.MultiRouter.html">MultiRouter</a></li>
		<li><a href="Nette.Application.Presenter.html">Presenter</a></li>
		<li><a href="Nette.Application.PresenterComponent.html">PresenterComponent</a></li>
		<li><a href="Nette.Application.PresenterLoader.html">PresenterLoader</a></li>
		<li><a href="Nette.Application.PresenterRequest.html">PresenterRequest</a></li>
		<li><a href="Nette.Application.RedirectingResponse.html">RedirectingResponse</a></li>
		<li><a href="Nette.Application.RenderResponse.html">RenderResponse</a></li>
		<li><a href="Nette.Application.Route.html">Route</a></li>
		<li><a href="Nette.Application.SimpleRouter.html">SimpleRouter</a></li>
	</ul>

	<h3>Interfaces</h3>

	<ul>
		<li><a href="Nette.Application.IPartiallyRenderable.html">IPartiallyRenderable</a></li>
		<li><a href="Nette.Application.IPresenter.html">IPresenter</a></li>
		<li><a href="Nette.Application.IPresenterLoader.html">IPresenterLoader</a></li>
		<li><a href="Nette.Application.IPresenterResponse.html">IPresenterResponse</a></li>
		<li><a href="Nette.Application.IRenderable.html">IRenderable</a></li>
		<li><a href="Nette.Application.IRouter.html">IRouter</a></li>
		<li><a href="Nette.Application.ISignalReceiver.html">ISignalReceiver</a></li>
		<li><a href="Nette.Application.IStatePersistent.html">IStatePersistent</a></li>
	</ul>

	<h3>Exceptions</h3>

	<ul>
		<li><a href="Nette.Application.AbortException.html">AbortException</a></li>
		<li><a href="Nette.Application.ApplicationException.html">ApplicationException</a></li>
		<li><a href="Nette.Application.BadRequestException.html">BadRequestException</a></li>
		<li><a href="Nette.Application.BadSignalException.html">BadSignalException</a></li>
		<li><a href="Nette.Application.ForbiddenRequestException.html">ForbiddenRequestException</a></li>
		<li><a href="Nette.Application.InvalidLinkException.html">InvalidLinkException</a></li>
		<li><a href="Nette.Application.InvalidPresenterException.html">InvalidPresenterException</a></li>
	</ul>
</div>

<div id="right">
	<form action="http://www.google.com/cse" id="search" onsubmit="if(this.q.value.indexOf('more:')==-1)this.q.value+=' more:api'">
		<input type="hidden" name="cx" value="011549293477758430224:vxofa9ufnhc" /><input type="hidden" name="ie" value="UTF-8" /><input type="text" name="q" class="text" /><input type="submit" value="Search" />
	</form>

<div id="navigation">
	<ul>
		<li><a href="overview.html" title="Summary of all namespaces">Overview</a></li>
		<li><a href="namespace-Nette.Application.html" title="Summary of Nette\Application">Namespace</a></li>
		<li class="active">Class</li>
		<li><a href="elements.html">Elements</a></li>
	</ul>
</div>

<div id="content">
	<div id="classSummary">
		<p>namespace <a href="namespace-Nette.Application.html">Nette\Application</a></p>

		<h1>Class Application</h1>

		<div class="classDescription">
		
<p>Front Controller.</p>

		</div>

		<dl class="tree">
			<dd style="padding-left:0px">
				<a href="Nette.Object.html">Nette\Object</a>
				
			</dd>
			<dd style="padding-left:30px">
				<img src="resources/inherit.gif" alt="extended by" />
<b>Nette\Application\Application</b>				
			</dd>
		</dl>



		<div class="classInfo">
			
				<b>Author:</b> David Grudl<br />
			<b>Located at</b> <a href="source-Application.Application.php.html#19">/Application/Application.php</a><br />
		</div>
	</div>


	<div id="methodSummary">
		<table class="summary">
		<caption>Method Summary</caption>
		<tr data-order="1 run" id="_run">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				void
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_run">#</a>
			<code class="nowrap">
				<a href="source-Application.Application.php.html#67" title="go to source code"><b>run</b></a>(
			)</code>

			<div class="short">
				
<p>Dispatch a HTTP request to a front controller.</p>

			</div>

			<div class="detailed">
				
<p>Dispatch a HTTP request to a front controller.</p>






			</div>
			</td>
		</tr>
		<tr data-order="1 getRequests" id="_getRequests">
			<td align="right" width="1%"><code class="nowrap">
				final public 
				array
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_getRequests">#</a>
			<code class="nowrap">
				<a href="source-Application.Application.php.html#211" title="go to source code"><b>getRequests</b></a>(
			)</code>

			<div class="short">
				
<p>Returns all processed requests.</p>

			</div>

			<div class="detailed">
				
<p>Returns all processed requests.</p>




					<h4>Returns</h4>
					<div class="smallList">array of PresenterRequest</div>


			</div>
			</td>
		</tr>
		<tr data-order="1 getPresenter" id="_getPresenter">
			<td align="right" width="1%"><code class="nowrap">
				final public 
				<a href="Nette.Application.Presenter.html">Presenter</a>
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_getPresenter">#</a>
			<code class="nowrap">
				<a href="source-Application.Application.php.html#222" title="go to source code"><b>getPresenter</b></a>(
			)</code>

			<div class="short">
				
<p>Returns current presenter.</p>

			</div>

			<div class="detailed">
				
<p>Returns current presenter.</p>




					<h4>Returns</h4>
					<div class="smallList"><a href="Nette.Application.Presenter.html">Presenter</a> </div>


			</div>
			</td>
		</tr>
		<tr data-order="1 getServiceLocator" id="_getServiceLocator">
			<td align="right" width="1%"><code class="nowrap">
				final public 
				<a href="Nette.IServiceLocator.html">Nette\IServiceLocator</a>
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_getServiceLocator">#</a>
			<code class="nowrap">
				<a href="source-Application.Application.php.html#237" title="go to source code"><b>getServiceLocator</b></a>(
			)</code>

			<div class="short">
				
<p>Gets the service locator (experimental).</p>

			</div>

			<div class="detailed">
				
<p>Gets the service locator (experimental).</p>




					<h4>Returns</h4>
					<div class="smallList"><a href="Nette.IServiceLocator.html">Nette\IServiceLocator</a> </div>


			</div>
			</td>
		</tr>
		<tr data-order="1 getService" id="_getService">
			<td align="right" width="1%"><code class="nowrap">
				final public 
				object
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_getService">#</a>
			<code class="nowrap">
				<a href="source-Application.Application.php.html#257" title="go to source code"><b>getService</b></a>(
					string
					<var>$name</var>, 
					array
					
					<var>$options</var> = <span class="php-keyword1">NULL</span>
			)</code>

			<div class="short">
				
<p>Gets the service object of the specified type.</p>

			</div>

			<div class="detailed">
				
<p>Gets the service object of the specified type.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$name</code> string service name<br />
						<code>$options</code> array options in case service is not singleton<br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">object </div>


			</div>
			</td>
		</tr>
		<tr data-order="1 getRouter" id="_getRouter">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				<a href="Nette.Application.IRouter.html">IRouter</a>
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_getRouter">#</a>
			<code class="nowrap">
				<a href="source-Application.Application.php.html#270" title="go to source code"><b>getRouter</b></a>(
			)</code>

			<div class="short">
				
<p>Returns router.</p>

			</div>

			<div class="detailed">
				
<p>Returns router.</p>




					<h4>Returns</h4>
					<div class="smallList"><a href="Nette.Application.IRouter.html">IRouter</a> </div>


			</div>
			</td>
		</tr>
		<tr data-order="1 setRouter" id="_setRouter">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				<a href="Nette.Application.Application.html">Application</a>
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_setRouter">#</a>
			<code class="nowrap">
				<a href="source-Application.Application.php.html#281" title="go to source code"><b>setRouter</b></a>(
					<a href="Nette.Application.IRouter.html">IRouter</a>
					
					<var>$router</var>
			)</code>

			<div class="short">
				
<p>Changes router.</p>

			</div>

			<div class="detailed">
				
<p>Changes router.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$router</code> <a href="Nette.Application.IRouter.html">IRouter</a> <br />
					</div>

					<h4>Returns</h4>
					<div class="smallList"><a href="Nette.Application.Application.html">Application</a> provides a fluent interface</div>


			</div>
			</td>
		</tr>
		<tr data-order="1 getPresenterLoader" id="_getPresenterLoader">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				<a href="Nette.Application.IPresenterLoader.html">IPresenterLoader</a>
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_getPresenterLoader">#</a>
			<code class="nowrap">
				<a href="source-Application.Application.php.html#294" title="go to source code"><b>getPresenterLoader</b></a>(
			)</code>

			<div class="short">
				
<p>Returns presenter loader.</p>

			</div>

			<div class="detailed">
				
<p>Returns presenter loader.</p>




					<h4>Returns</h4>
					<div class="smallList"><a href="Nette.Application.IPresenterLoader.html">IPresenterLoader</a> </div>


			</div>
			</td>
		</tr>
		<tr data-order="0 createPresenterLoader" id="_createPresenterLoader">
			<td align="right" width="1%"><code class="nowrap">
				 public static
				<a href="Nette.Application.IPresenterLoader.html">IPresenterLoader</a>
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_createPresenterLoader">#</a>
			<code class="nowrap">
				<a href="source-Application.Application.php.html#309" title="go to source code"><b>createPresenterLoader</b></a>(
			)</code>

			<div class="short">
				
			</div>

			<div class="detailed">
				



					<h4>Returns</h4>
					<div class="smallList"><a href="Nette.Application.IPresenterLoader.html">IPresenterLoader</a> </div>


			</div>
			</td>
		</tr>
		<tr data-order="1 storeRequest" id="_storeRequest">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				string
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_storeRequest">#</a>
			<code class="nowrap">
				<a href="source-Application.Application.php.html#323" title="go to source code"><b>storeRequest</b></a>(
					mixed
					<var>$expiration</var> = <span class="php-quote">'+ 10 minutes'</span>
			)</code>

			<div class="short">
				
<p>Stores current request to session.</p>

			</div>

			<div class="detailed">
				
<p>Stores current request to session.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$expiration</code> mixed optional expiration time<br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">string key</div>


			</div>
			</td>
		</tr>
		<tr data-order="1 restoreRequest" id="_restoreRequest">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				void
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_restoreRequest">#</a>
			<code class="nowrap">
				<a href="source-Application.Application.php.html#342" title="go to source code"><b>restoreRequest</b></a>(
					string
					<var>$key</var>
			)</code>

			<div class="short">
				
<p>Restores current request to session.</p>

			</div>

			<div class="detailed">
				
<p>Restores current request to session.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$key</code> string key<br />
					</div>



			</div>
			</td>
		</tr>
		<tr data-order="1 getHttpRequest" id="_getHttpRequest">
			<td align="right" width="1%"><code class="nowrap">
				 protected 
				<a href="Nette.Web.IHttpRequest.html">Nette\Web\IHttpRequest</a>
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_getHttpRequest">#</a>
			<code class="nowrap">
				<a href="source-Application.Application.php.html#364" title="go to source code"><b>getHttpRequest</b></a>(
			)</code>

			<div class="short">
				
			</div>

			<div class="detailed">
				



					<h4>Returns</h4>
					<div class="smallList"><a href="Nette.Web.IHttpRequest.html">Nette\Web\IHttpRequest</a> </div>


			</div>
			</td>
		</tr>
		<tr data-order="1 getHttpResponse" id="_getHttpResponse">
			<td align="right" width="1%"><code class="nowrap">
				 protected 
				<a href="Nette.Web.IHttpResponse.html">Nette\Web\IHttpResponse</a>
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_getHttpResponse">#</a>
			<code class="nowrap">
				<a href="source-Application.Application.php.html#374" title="go to source code"><b>getHttpResponse</b></a>(
			)</code>

			<div class="short">
				
			</div>

			<div class="detailed">
				



					<h4>Returns</h4>
					<div class="smallList"><a href="Nette.Web.IHttpResponse.html">Nette\Web\IHttpResponse</a> </div>


			</div>
			</td>
		</tr>
		<tr data-order="1 getSession" id="_getSession">
			<td align="right" width="1%"><code class="nowrap">
				 protected 
				<a href="Nette.Web.Session.html">Nette\Web\Session</a>
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_getSession">#</a>
			<code class="nowrap">
				<a href="source-Application.Application.php.html#384" title="go to source code"><b>getSession</b></a>(
					
					<var>$namespace</var> = <span class="php-keyword1">NULL</span>
			)</code>

			<div class="short">
				
			</div>

			<div class="detailed">
				



					<h4>Returns</h4>
					<div class="smallList"><a href="Nette.Web.Session.html">Nette\Web\Session</a> </div>


			</div>
			</td>
		</tr>

		</table>
	</div>


	<h2>Methods Inherited From <a href="Nette.Object.html#methodSummary">Nette\Object</a></h2>
	<div class="box"><code>
		<a href="Nette.Object.html#_getClass" class="deprecated">getClass()</a>, <a href="Nette.Object.html#_getReflection">getReflection()</a>, <a href="Nette.Object.html#___call">__call()</a>, <a href="Nette.Object.html#___callStatic">__callStatic()</a>, <a href="Nette.Object.html#_extensionMethod">extensionMethod()</a>, <a href="Nette.Object.html#___get">__get()</a>, <a href="Nette.Object.html#___set">__set()</a>, <a href="Nette.Object.html#___isset">__isset()</a>, <a href="Nette.Object.html#___unset">__unset()</a>
	</code></div>





	<div id="propertySummary">
		<table class="summary">
		<caption>Property Summary</caption>
		<tr data-order="maxLoop" id="$maxLoop">
			<td align="right" width="1%"><code class="nowrap">
				 static
				int
			</code></td>

			<td width="1%"><var>$maxLoop</var></td>
			<td><pre><span class="php-num">20</span></pre></td>
			<td> <a href="#$maxLoop" class="anchor">#</a></td>
		</tr>
		<tr data-order="defaultServices" id="$defaultServices">
			<td align="right" width="1%"><code class="nowrap">
				 
				array
			</code></td>

			<td width="1%"><var>$defaultServices</var></td>
			<td><pre><span class="php-keyword1">array</span> (
  <span class="php-quote">'Nette\\Application\\IRouter'</span> =&gt; <span class="php-quote">'Nette\\Application\\MultiRouter'</span>,
  <span class="php-quote">'Nette\\Application\\IPresenterLoader'</span> =&gt; 
  <span class="php-keyword1">array</span> (
    <span class="php-num">0</span> =&gt; <span class="php-quote">'Nette\\Application\\Application'</span>,
    <span class="php-num">1</span> =&gt; <span class="php-quote">'createPresenterLoader'</span>,
  ),
)</pre></td>
			<td> <a href="#$defaultServices" class="anchor">#</a></td>
		</tr>
		<tr data-order="catchExceptions" id="$catchExceptions">
			<td align="right" width="1%"><code class="nowrap">
				 
				bool
			</code></td>

			<td width="1%"><var>$catchExceptions</var></td>
			<td><pre><span class="php-keyword1">NULL</span></pre></td>
			<td>enable fault barrier? <a href="#$catchExceptions" class="anchor">#</a></td>
		</tr>
		<tr data-order="errorPresenter" id="$errorPresenter">
			<td align="right" width="1%"><code class="nowrap">
				 
				string
			</code></td>

			<td width="1%"><var>$errorPresenter</var></td>
			<td><pre><span class="php-keyword1">NULL</span></pre></td>
			<td> <a href="#$errorPresenter" class="anchor">#</a></td>
		</tr>
		<tr data-order="onStartup" id="$onStartup">
			<td align="right" width="1%"><code class="nowrap">
				 
				array
			</code></td>

			<td width="1%"><var>$onStartup</var></td>
			<td><pre><span class="php-keyword1">NULL</span></pre></td>
			<td>of function(Application $sender); Occurs before the application loads presenter <a href="#$onStartup" class="anchor">#</a></td>
		</tr>
		<tr data-order="onShutdown" id="$onShutdown">
			<td align="right" width="1%"><code class="nowrap">
				 
				array
			</code></td>

			<td width="1%"><var>$onShutdown</var></td>
			<td><pre><span class="php-keyword1">NULL</span></pre></td>
			<td>of function(Application $sender, \Exception $e = NULL); Occurs before the
application shuts down <a href="#$onShutdown" class="anchor">#</a></td>
		</tr>
		<tr data-order="onRequest" id="$onRequest">
			<td align="right" width="1%"><code class="nowrap">
				 
				array
			</code></td>

			<td width="1%"><var>$onRequest</var></td>
			<td><pre><span class="php-keyword1">NULL</span></pre></td>
			<td>of function(Application $sender, PresenterRequest $request); Occurs when a new
request is ready for dispatch <a href="#$onRequest" class="anchor">#</a></td>
		</tr>
		<tr data-order="onError" id="$onError">
			<td align="right" width="1%"><code class="nowrap">
				 
				array
			</code></td>

			<td width="1%"><var>$onError</var></td>
			<td><pre><span class="php-keyword1">NULL</span></pre></td>
			<td>of function(Application $sender, \Exception $e); Occurs when an unhandled
exception occurs in the application <a href="#$onError" class="anchor">#</a></td>
		</tr>
		<tr data-order="allowedMethods" id="$allowedMethods">
			<td align="right" width="1%"><code class="nowrap">
				 
				array
			</code></td>

			<td width="1%"><var>$allowedMethods</var></td>
			<td><pre><span class="php-keyword1">array</span> (
  <span class="php-num">0</span> =&gt; <span class="php-quote">'GET'</span>,
  <span class="php-num">1</span> =&gt; <span class="php-quote">'POST'</span>,
  <span class="php-num">2</span> =&gt; <span class="php-quote">'HEAD'</span>,
  <span class="php-num">3</span> =&gt; <span class="php-quote">'PUT'</span>,
  <span class="php-num">4</span> =&gt; <span class="php-quote">'DELETE'</span>,
)</pre></td>
			<td>of string <a href="#$allowedMethods" class="anchor">#</a></td>
		</tr>

		</table>
	</div>


</div>

	<div id="footer">
		Nette Framework API documentation generated by <a href="http://apigen.org">ApiGen</a>
	</div>
</div>
</body>
</html>
